-- GENERATED SPELL FOR [Eranikus, Tyrant of the Dream] --


function spell0_15491(pUnit, Event) --@Acid Breath,n/a--
pUnit:FullCastSpellOnTarget(24839,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15491', 45000, 1)
end

function spell1_15491(pUnit, Event) --@Noxious Breath,Self--
pUnit:FullCastSpellOnTarget(24818,pUnit)
pUnit:RegisterEvent('Sorts_15491', 30000, 1)
end

function spell2_15491(pUnit, Event) --@Shadow Bolt Volley,n/a--
pUnit:FullCastSpellOnTarget(25586,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15491', 632, 1)
end

function Sorts_15491(pUnit, Event)
local choix_sorts_15491 = math.random(0, 2)
if choix_sorts_15491 == 0 then
pUnit:RegisterEvent('spell0_15491', 1, 1)
end
if choix_sorts_15491 == 1 then
pUnit:RegisterEvent('spell1_15491', 1, 1)
end
if choix_sorts_15491 == 2 then
pUnit:RegisterEvent('spell2_15491', 1, 1)
end
end

function mob15491_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15491', math.random(1500, 3000), 1)
end

function mob15491_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15491_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15491_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15491, 1, 'mob15491_Action')
RegisterUnitEvent(15491, 2, 'mob15491_Leave')
RegisterUnitEvent(15491, 3, 'mob15491_Kill')
RegisterUnitEvent(15491, 4, 'mob15491_Die')
